package com.dingding.special.order.bill.dao.impl;

import java.util.List;

import javax.annotation.Resource;

import org.springframework.stereotype.Repository;

import com.dingding.common.core.base.daox.impl.SQLBaseDaoImpl;
import com.dingding.special.order.bill.dao.WaterBillDao;
import com.dingding.special.order.bill.dto.OrderFinishAmountDTO;
import com.dingding.special.order.bill.dto.OrderFinishRateDTO;
import com.dingding.special.order.bill.dto.OrderParticularsDTO;
import com.dingding.special.order.bill.dto.ReqWaterBillDTO;
import com.dingding.special.order.bill.dto.ResWaterBillDTO;
import com.dingding.special.order.bill.sql.QueryWaterBillSql;

/**
 * @ClassName: WaterBillDaoImpl
 * @Description: 账单流水Dao实现类
 * @author SUNZHICHENG
 * @date 2016年8月22日 下午12:00:39
 * @version v2.4.0
 * 
 */
@Repository("waterBillDao")
public class WaterBillDaoImpl implements WaterBillDao {

	@Resource(name = "SQLBaseDao")
	SQLBaseDaoImpl sqlBaseDaoImpl;

	/**
	 * 
	 * @Title: queryWaterBill
	 * @Description: 查询时间段内所有的账单流水
	 * @param
	 * @return List<Userspecialorder>
	 * @author SUNZHICHENG
	 * @date 上午11:57:41
	 * @since v2.4.0
	 */
	@Override
	public List<ResWaterBillDTO> queryWaterBill(ReqWaterBillDTO req) {

		List<ResWaterBillDTO> countBill = sqlBaseDaoImpl.listSqlToCustomBean(ResWaterBillDTO.class,
				QueryWaterBillSql.QUERY_WATER_BILL, req.getUserId(), req.getStartTime(), req.getEndTime());

		return countBill;
	}
	
	/**
	 * 
	 * @Title: queryTaxiWaterBill 
	 * @Description: 查询时间段内所有的账单流水(出租车)
	 * @param reqWaterBillDTO 客户端请求Bean
	 * @author YHQ 
	 * @since V2.5.6
	 * @return List<ResWaterBillDTO>    返回类型
	 * 
	 */
	@Override
	public List<ResWaterBillDTO> queryTaxiWaterBill(ReqWaterBillDTO reqWaterBillDTO){
		
		List<ResWaterBillDTO> countBill = sqlBaseDaoImpl.listSqlToCustomBean(ResWaterBillDTO.class,
				QueryWaterBillSql.QUERY_TAXI_WATER_BILL, reqWaterBillDTO.getUserId(), reqWaterBillDTO.getStartTime(), reqWaterBillDTO.getEndTime());

		return countBill;
	}

	/**
	 * 
	 * @Title: queryOrderFinishAmount
	 * @Description: 查询日期内订单完成数详情
	 * @param ReqWaterBillDTO
	 *            请求参数Bean
	 * @return List<ResOrderFinishAmountDTO>
	 * @author SUNZHICHENG
	 * @date 2016年8月23日 下午7:21:20
	 * @since v2.4.0
	 */
	@Override
	public List<OrderFinishAmountDTO> queryOrderFinishAmount(ReqWaterBillDTO req) {

		List<OrderFinishAmountDTO> orderFinishAmount = sqlBaseDaoImpl.listSqlToCustomBean(OrderFinishAmountDTO.class,
				QueryWaterBillSql.QUERY_ORDER_PARTICULARS, req.getUserId(), req.getStartTime(), req.getEndTime());
		return orderFinishAmount;
	}

	/**
	 * 
	 * @Title: queryTaxiOrderFinishAmount 
	 * @Description: 查询日期内订单完成数详情(出租车) 
	 * @param reqWaterBillDTO 客户端请求Bean
	 * @author YHQ 
	 * @since V2.5.6
	 * @return List<OrderFinishAmountDTO>    返回类型
	 * 
	 */
	@Override
	public List<OrderFinishAmountDTO> queryTaxiOrderFinishAmount(ReqWaterBillDTO reqWaterBillDTO){
		
		List<OrderFinishAmountDTO> orderFinishAmount = sqlBaseDaoImpl.listSqlToCustomBean(OrderFinishAmountDTO.class,
				QueryWaterBillSql.QUERY_TAXI_ORDER_PARTICULARS, reqWaterBillDTO.getUserId(), reqWaterBillDTO.getStartTime(), reqWaterBillDTO.getEndTime());
		return orderFinishAmount;
	}
	
	/**
	 * 
	 * @Title: queryOrderParticulars
	 * @Description: 查询日期内账单流水详情
	 * @param ReqWaterBillDTO
	 *            请求参数Bean
	 * @return List<OrderParticularsDTO>
	 * @author SUNZHICHENG
	 * @date 2016年8月24日 上午9:56:57
	 * @since v2.4.0
	 */

	@Override
	public List<OrderParticularsDTO> queryOrderParticulars(ReqWaterBillDTO req) {
		List<OrderParticularsDTO> orderParticulars = sqlBaseDaoImpl.listSqlToCustomBean(OrderParticularsDTO.class,
				QueryWaterBillSql.QUERY_ORDER_WATER, req.getUserId(), req.getStartTime(), req.getEndTime());
		return orderParticulars;
	}

	/**
	 * 
	 * @Title: queryTaxiOrderParticulars 
	 * @Description: 查询日期内出租车订单流水详情 
	 * @param reqWaterBillDTO 客户端请求参数Bean
	 * @author YHQ 
	 * @since V2.5.6
	 * @return List<OrderParticularsDTO>    返回类型
	 */
	@Override
	public List<OrderParticularsDTO> queryTaxiOrderParticulars(ReqWaterBillDTO reqWaterBillDTO){
		List<OrderParticularsDTO> orderParticulars = sqlBaseDaoImpl.listSqlToCustomBean(OrderParticularsDTO.class,
				QueryWaterBillSql.QUERY_TAXI_ORDER_WATER, reqWaterBillDTO.getUserId(), reqWaterBillDTO.getStartTime(), reqWaterBillDTO.getEndTime());
		return orderParticulars;
	}
	
	/**
	 * 
	 * @Title: queryOrderFinishRate
	 * @Description: 查询日期内订单完成率详情
	 * @param eqWaterBillDTO
	 *            请求参数Bean
	 * @return List<OrderFinishRateDTO>
	 * @author SUNZHICHENG
	 * @date 2016年8月24日 下午2:22:35
	 * @since v2.4.0
	 */
	@Override
	public List<OrderFinishRateDTO> queryOrderFinishRate(ReqWaterBillDTO req) {
		List<OrderFinishRateDTO> orderFinishRateList = sqlBaseDaoImpl.listSqlToCustomBean(OrderFinishRateDTO.class,
				QueryWaterBillSql.QUERY_ORDER_FINISHRATE, req.getUserId(), req.getStartTime(), req.getEndTime());
		return orderFinishRateList;
	}

	/**
	 * 
	 * @Title: queryTaxiOrderFinishRate 
	 * @Description: 查询日期内订单完成率详情（出租车）
	 * @param reqWaterBillDTO 客户端请求Bean
	 * @author YHQ 
	 * @since V2.5.6
	 * @return List<OrderFinishRateDTO>    返回类型
	 * 
	 */
	@Override
	public List<OrderFinishRateDTO> queryTaxiOrderFinishRate(ReqWaterBillDTO reqWaterBillDTO){
		
		List<OrderFinishRateDTO> orderFinishRateList = sqlBaseDaoImpl.listSqlToCustomBean(OrderFinishRateDTO.class,
				QueryWaterBillSql.QUERY_TAXI_ORDER_FINISHRATE, reqWaterBillDTO.getUserId(), reqWaterBillDTO.getStartTime(), reqWaterBillDTO.getEndTime());
		return orderFinishRateList;
	}
	
}
